import pickle
import redis
import pandas as pd


with open('gps_location.pickle', 'rb') as f:
    gps_location_list = pickle.load(f)

# gps_location_list = {}

print(pd.DataFrame(gps_location_list).T)

r = redis.Redis(db=0)

if __name__ == '__main__':
    while True:
        key = input('press enter to continue')

        lat = float(r.get('lat'))
        lon = float(r.get('lon'))
        hAcc = float(r.get('hAcc'))

        gps_location_list[key] = [lat, lon, hAcc]

        with open('gps_location.pickle', 'wb') as f:
            pickle.dump(gps_location_list, f)
